package com.qf.common.exceptions;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionsHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Resp handleExceptions(Exception e) {
        Resp resp = new Resp();
        resp.setStatus(Resp.RESP_STATUS.FAILED.getCode());
        resp.setMessage(e.getMessage());
        return resp;
    }
}
